package thesis.database;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

/**
 * This class use for taxi object.
 * 
 * @author La Duy Khang - Dinh Tran Ly Hung -Tang Thi Phuong Linh
 * @version 1.0
 */
public class User implements Serializable {
	private int userId;
	private String name;
	private String userName;
	private String password;
	private String userType;
	private String birthPlace;
	private Timestamp birthDay;
	private boolean gender;
	private String address;
	private String phoneNumber;
	private String email;
	private Timestamp creationTime;
	private Timestamp lastUpdate;
	private Timestamp lastLoginTime;
	private boolean active;
	private String identifyNumber;

	public User() {
		this.userId = -1;
		this.name = "";
		this.userName = "";
		this.password = "";
		this.userType = "";
		this.birthDay = new Timestamp((new Date().getTime()));
		this.birthPlace = "";
		this.gender = false;
		this.address = "";
		this.phoneNumber = "";
		this.email = "";
		this.creationTime = new Timestamp((new Date().getTime()));
		this.lastLoginTime = new Timestamp((new Date().getTime()));
		this.lastUpdate = new Timestamp((new Date().getTime()));
		this.active = false;
		this.identifyNumber = "";
	}

	public User(int userId, String name, String userName, String password,
			String userType, Timestamp birthDay, String birthPlace,
			boolean gender, String address, String phoneNumber, String email,
			Timestamp creationTime, Timestamp lassLoginTime,
			Timestamp lastUpdate, boolean active, String identifyNember) {
		this.userId = userId;
		this.name = name;
		this.userName = userName;
		this.password = password;
		this.userType = userType;
		this.birthDay = birthDay;
		this.birthPlace = birthPlace;
		this.gender = gender;
		this.address = address;
		this.phoneNumber = phoneNumber;
		this.email = email;
		this.creationTime = creationTime;
		this.lastLoginTime = lassLoginTime;
		this.lastUpdate = lastUpdate;
		this.active = active;
		this.identifyNumber = identifyNember;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public String getBirthPlace() {
		return birthPlace;
	}

	public void setBirthPlace(String birthPlace) {
		this.birthPlace = birthPlace;
	}

	public Date getBirthDay() {
		return birthDay;
	}

	public void setBirthDay(Date birthDay) {
		if (birthDay == null)
			this.birthDay = new Timestamp(new Date().getTime());
		else
			this.birthDay = new Timestamp(birthDay.getTime());
	}

	public boolean getGender() {
		return gender;
	}

	public void setGender(boolean gender) {
		this.gender = gender;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Date getCreationTime() {
		return creationTime;
	}

	public void setCreationTime(Timestamp creationTime) {
		this.creationTime = creationTime;
	}

	public Date getLastUpdate() {
		return lastUpdate;
	}

	public void setLastUpdate(Timestamp lastUpdate) {
		this.lastUpdate = lastUpdate;
	}

	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	public void setLastLoginTime(Timestamp lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public String getIdentifyNumber() {
		return identifyNumber;
	}

	public void setIdentifyNumber(String identifyNumber) {
		this.identifyNumber = identifyNumber;
	}

}
